package com.gjh.xiaokabang2code.mapper;

import com.gjh.xiaokabang2code.model.SuccessMatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author tsin0
 * @description 针对表【success_match】的数据库操作Mapper
 * @createDate 2024-03-08 08:58:38
 * @Entity com.gjh.xiaokabang2code.model.SuccessMatch
 */
public interface SuccessMatchMapper extends BaseMapper<SuccessMatch> {

    @Select("SELECT * FROM success_match WHERE create_time <= #{thresholdTime} AND success_status = 0")
    List<SuccessMatch> findRecordsBeforeThreshold(@Param("thresholdTime") LocalDateTime thresholdTime);

    void batchUpdateSuccessStatus(@Param("list") List<SuccessMatch> successMatches);
}




